package com.xu.sso.web.service;

import com.xu.sso.core.exception.SSOException;
import com.xu.sso.core.model.BaseResponse;
import com.xu.sso.db.model.base.App;
import com.xu.sso.db.model.base.AppRole;
import com.xu.sso.web.model.request.AddAppRequest;
import com.xu.sso.web.model.request.AppSearchRequest;
import com.xu.sso.web.model.request.ChangeAppRequest;

import java.util.List;

public interface AppService {

    List<App> findAllApp();

    List<App> findAllStartWebApp();

    List<App> findAllServerApp();

    List<App> findAllStartApp();

    List<App> findAllAppByUser(String username);

    List<App> findAllAppByLeader(String username);

    List<App> findAppList(AppSearchRequest request);

    App findAppByAppId(String appId);

    BaseResponse checkAppExist(String appId) throws SSOException;

    BaseResponse createApp(AddAppRequest request, String username) throws SSOException;

    BaseResponse deleteAppUser(String appId, String username) throws SSOException;

    BaseResponse checkLeader(String appId, String username) throws SSOException;

    BaseResponse changeStatus(String appId, String status, String username) throws SSOException;

    BaseResponse changeApp(ChangeAppRequest request) throws SSOException;

    List<AppRole> findAppRoles(String appId);

    boolean isLeader(String appId, String username);

    BaseResponse deleteApp(String appId) throws SSOException;

}
